home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Dmod / dmod_Identify / examples / myexp.d < prev   
Text File  |  2002-10-28  |  1KB  |  38 lines

  1. OPT DOSONLY
  2.  
  3. // A small example for using the identify.library. (C) 1997 by Richard Körber -- All Rights Reserved
  4. // Converted by DMX in 2002.
  5.  
  6. MODULE 'exec/memory','libraries/identify','identify','libraries/configregs','libraries/configvars','utility/tagitem'
  7.  
  8. DEF IdentifyBase
  9.  
  10. PROC main()(INT)
  11.  
  12.   IF IdentifyBase:=OpenLibrary('identify.library',6)
  13.     DEF expans=NIL:PTR TO ConfigDev,counter=0:UW,size:UW,unit:UW
  14.     DEF manuf[IDENTIFYBUFLEN]:CHAR,prod[IDENTIFYBUFLEN]:CHAR,pclass[IDENTIFYBUFLEN]:CHAR
  15.     PrintF('Nr Address  Size Description\n'+
  16.            '----------------------------------------------------------\n');
  17.     WHILEN IdExpansionTags(
  18.             IDTAG_ManufStr ,&manuf,
  19.             IDTAG_ProdStr  ,&prod,
  20.             IDTAG_ClassStr ,&pclass,
  21.             IDTAG_Expansion,&expans,
  22.             TAG_DONE)
  23.       unit:="K"
  24.       size:=expans.BoardSize>>10
  25.       IF size>=1024
  26.         unit:="M"
  27.         size := size>>10
  28.       ENDIF
  29.       PrintF('\z\d[2] \z\h[8] \z\d[3]\c \s \s (\s)\n',
  30.              ++counter,
  31.              expans.BoardAddr, size, unit,
  32.              prod, pclass, manuf);
  33.     ENDWHILE
  34.     CloseLibrary(IdentifyBase)
  35.   ENDIF
  36.   RETURN 0
  37. ENDPROC
  38.